<!DOCTYPE html>
<html lang="vi">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chi tiết đơn hàng <?php echo $this->model->fullname?></title>
<style type="text/css">
table tr td span
{
	font-weight: bold;
	font-size: 16px;
}
</style>
</head>
<body>
<table>
	<tr>
		<td><h1>ĐƠN HÀNG</h1></td>
	</tr>
	<tr>
		<td><span>Trạng thái:</span> <?php if($this->model->status == 0) { echo "Chờ xử lý"; } else { echo "Đã xử lý"; }?></td>
	</tr>
	<tr>
		<td height="10"></td>
	</tr>
	<tr>
		<td colspan="2"><span>Thông tin người mua hàng</span></td>
	</tr>
	<tr>
		<td>
			<table border="1" width="600">
				<tr>
					<td><span>Họ và tên:</span> <?php echo $this->model->fullname?></td>
					<td><span>Số CMND:</span> <?php echo $this->model->indentity_card?></td>
				</tr>
				<tr>
					<td><span>Địa chỉ:</span> <?php echo $this->model->address?></td>
					<td><span>Điện thoại:</span> <?php echo $this->model->phone?></td>
				</tr>
				<tr>
					<td colspan="2"><span>Email:</span> <?php echo $this->model->email?></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td height="10"></td>
	</tr>
	<tr>
		<td colspan="2"><span>Thông tin sản phẩm</span></td>
	</tr>
	<tr>
		<td>
			<table border="1" width="600">
				<thead>
					<th>Mã sản phẩm</th>
					<th>Tên sản phẩm</th>
					<th>Số lượng</th>
					<th>Đơn giá</th>
					<th>Thành tiền</th>
				</thead>
				<tbody>
				<?php 
					foreach ($this->detailList as $detail)
					{
				?>
					<tr>
						<td><a onclick="openProduct(this);" href="#" rel="<?php echo $this->url->action("detail", "Products", array($detail['productID']))?>"><?php echo $detail['productID']?></td>
						<td><?php echo $detail['productName']?></td>
						<td><?php echo $detail['quantity']?></td>
						<td><?php echo number_format($detail['price'], 0, ',', '.')?></td>
						<td><?php echo number_format((int)$detail['quantity'] * (float)$detail['price'], 0, ',', '.')?></td>
					</tr>
				<?php 
					}
				?>
				</tbody>
				<tfoot>
					<th colspan="5" align="right">Tổng tiền: <?php echo number_format($this->sum, 0, ',', '.')?></th>
				</tfoot>
			</table>
		</td>
	</tr>
</table>
<?php $this->html->loadJS("content/gmode_admin/js/jquery-1.5.1.min.js")?>
<script type="text/javascript">
function openProduct(ele)
{
	window.open($(ele).attr("rel"), "Chi tiết sản phẩm", "width=800,height=400");
}
</script>
</body>
</html>